// 获取当前经纬度
function getPoint(){
  var map = new BMap.Map("point");
  var point = new BMap.Point(116.331398,39.897445);
  map.centerAndZoom(point,12);

  var geolocation = new BMap.Geolocation();
  geolocation.getCurrentPosition(function(r){
    if(this.getStatus() == BMAP_STATUS_SUCCESS){
      var mk = new BMap.Marker(r.point);
      map.addOverlay(mk);
      map.panTo(r.point);
      localStorage.setItem("point",r.point.lat +','+r.point.lng);
      getGuess();
    }
    else {
      alert('failed'+this.getStatus());
    }
  },{enableHighAccuracy: true})
}
getPoint();

// 获取当前城市
var cityName = window.localStorage.getItem("cityName");
if(!cityName){
  var myCity = new BMap.LocalCity();
  myCity.get(cityFun);
}

function cityFun(result){
  var cityName = result.name.slice(0,-1);
  $("#cCity,#currenCity").text(cityName)
  localStorage.setItem("cityName",cityName);
}